import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: resolve => require(['../components/common/Home.vue'], resolve),
            meta: { title: '自述文件' },
            children:[
                {
                    path: '/dashboard',
                    component: resolve => require(['../components/page/Dashboard.vue'], resolve),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/icon',
                    component: resolve => require(['../components/page/Icon.vue'], resolve),
                    meta: { title: '自定义图标' }
                },
                {
                    path: '/modifyPwd',
                    component: resolve => require(['../components/page/SystemSet/ModifyPwd.vue'], resolve),
                    meta: { title: '密码修改' }
                },
                {
                    path: '/operatorManage',
                    component: resolve => require(['../components/page/SystemSet/OperatorManage.vue'], resolve),
                    meta: { title: '操作员管理' }
                },
                {
                    path: '/roleManage',
                    component: resolve => require(['../components/page/SystemSet/RoleManage.vue'], resolve),
                    meta: { title: '角色管理' }
                },
                {
                    path: '/authManage',
                    component: resolve => require(['../components/page/SystemSet/AuthManage.vue'], resolve),
                    meta: { title: '权限管理' }
                },
                // {
                //     // 权限页面
                //     path: '/permission',
                //     component: resolve => require(['../components/page/Permission.vue'], resolve),
                //     meta: { title: '权限测试', permission: true }
                // },
                {
                    path: '/userInfo',
                    component: resolve => require(['../components/page/UserManage/UserInfo.vue'], resolve),
                    meta: { title: '用户信息' }
                },

                {
                    path: '/merchantList',
                    component: resolve => require(['../components/page/MerchantManage/MerchantList.vue'], resolve),
                    meta: { title: '商户列表' }
                },
                {
                    path: '/merchantInfo',
                    component: resolve => require(['../components/page/MerchantManage/MerchantInfo.vue'], resolve),
                    meta: { title: '商户信息' }
                },
                {
                    path: '/agentList',
                    component: resolve => require(['../components/page/AgentManage/AgentList.vue'], resolve),
                    meta: { title: '代理商列表' }
                },{
                    path: '/agentInfo',
                    component: resolve => require(['../components/page/AgentManage/AgentInfo.vue'], resolve),
                    meta: { title: '代理商信息' }
                },
                {
                    path: '/orderList',
                    component: resolve => require(['../components/page/TransManage/OrderList.vue'], resolve),
                    meta: { title: '订单流水查询' }
                },
                {
                    path: '/agentSettle',
                    component: resolve => require(['../components/page/SettleManage/AgentSettle.vue'], resolve),
                    meta: { title: '代理商结算单查询' }
                },
                {
                    path: '/merchantSettle',
                    component: resolve => require(['../components/page/SettleManage/MerchantSettle.vue'], resolve),
                    meta: { title: '商户结算单查询' }
                },
                {
                    path: '/merchantDay',
                    component: resolve => require(['../components/page/ReportStatistics/MerchantDay.vue'], resolve),
                    meta: { title: '商户订日单统计' }
                },
                {
                    path: '/tradeType',
                    component: resolve => require(['../components/page/ReportStatistics/TradeType.vue'], resolve),
                    meta: { title: '交易类型订单统计' }
                },
                {
                    path: '/bossDay',
                    component: resolve => require(['../components/page/ReportStatistics/BossDay.vue'], resolve),
                    meta: { title: '平台日订单统计' }
                },
                {
                    path: '/agentProfit',
                    component: resolve => require(['../components/page/ReportStatistics/AgentProfit.vue'], resolve),
                    meta: { title: '代理商分润统计' }
                },
                {
                    path: '/merchantProfit',
                    component: resolve => require(['../components/page/ReportStatistics/MerchantProfit.vue'], resolve),
                    meta: { title: '商户分润统计' }
                },
                {
                    path: '/hardwareInfo',
                    component: resolve => require(['../components/page/HardwareManage/HardwareInfo.vue'], resolve),
                    meta: { title: '硬件信息' }
                },
                {
                    path: '/hardwareList',
                    component: resolve => require(['../components/page/HardwareManage/HardwareList.vue'], resolve),
                    meta: { title: '硬件管理' }
                },
                {
                    path: '/404',
                    component: resolve => require(['../components/page/404.vue'], resolve),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: resolve => require(['../components/page/403.vue'], resolve),
                    meta: { title: '403' }
                }
            ]
        },
        {
            path: '/login',
            component: resolve => require(['../components/page/Login.vue'], resolve)
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
})
